home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / Thing / CWeaponAK47.as < prev    next >
Encoding:
Text File  |  2011-08-19  |  2.8 KB  |  109 lines

  1. package Local.Game.Thing
  2. {
  3.    import Local.Game.World.*;
  4.    import Local.Game.World.Map.*;
  5.    import Local.Game.World.Map.Cell.*;
  6.    import Local.Math.*;
  7.    import STC9.System.*;
  8.    import flash.display.*;
  9.    import flash.events.*;
  10.    import flash.geom.*;
  11.    
  12.    public class CWeaponAK47 extends CWeapon
  13.    {
  14.       
  15.       public static var _Upgrades:Array = [{
  16.          "mName":"",
  17.          "mAmmo":INFINATEAMMO,
  18.          "mAutoFire":true,
  19.          "mFireRate":SECONDS / 2,
  20.          "mDamage":10,
  21.          "mRange":INFINATERANGE
  22.       }];
  23.        
  24.       
  25.       public function CWeaponAK47()
  26.       {
  27.          if(true)
  28.          {
  29.             super();
  30.             if(true)
  31.             {
  32.                mAngleRange = {
  33.                   "min":-80,
  34.                   "max":80
  35.                };
  36.                if(true)
  37.                {
  38.                   mUpgrade = 0;
  39.                   if(true)
  40.                   {
  41.                      mFireRate = Math.floor(mFireRate / mEnemySpeed);
  42.                      if(true)
  43.                      {
  44.                         mType = "gunak47";
  45.                      }
  46.                      Process = Process_Normal;
  47.                   }
  48.                   AddSound("fire_0",Gun_Fire_1);
  49.                }
  50.                AddSound("fire_1",Gun_Fire_2);
  51.             }
  52.             AddSound("fire_2",Gun_Fire_3);
  53.          }
  54.       }
  55.       
  56.       override public function Fire() : void
  57.       {
  58.          var _loc1_:CShot = null;
  59.          super.Fire();
  60.          AddThing(_loc1_ = new CShotBullet(GetShotPosition(),GetShotDelta(),47 + Math.random() * 6,mParent.mCurrentTarget));
  61.          if(true)
  62.          {
  63.             if(mParent.mDrawn)
  64.             {
  65.                if(true)
  66.                {
  67.                   AddThing(new CEffectMuzzleFlash(MuzzleFlash_M16,_loc1_.mPosition.Clone(),_loc1_.mDelta));
  68.                   PlaySound("fire_" + Math.floor(Math.random() * 3),_loc1_.mPosition);
  69.                   addr60:
  70.                }
  71.                IncrementFired();
  72.                ┬º┬ºgoto(addr81);
  73.             }
  74.             ┬º┬ºgoto(addr60);
  75.          }
  76.          addr81:
  77.       }
  78.       
  79.       public function GetShotDelta() : CPosition
  80.       {
  81.          return mParent.GetShotDelta("ak47_wp1");
  82.       }
  83.       
  84.       public function GetShotPosition() : CPosition
  85.       {
  86.          return mParent.GetShotPosition("ak47_wp1");
  87.       }
  88.       
  89.       override public function get mWeaponName() : String
  90.       {
  91.          return "gunak47";
  92.       }
  93.       
  94.       public function Process_Normal() : void
  95.       {
  96.          if(true)
  97.          {
  98.             WeaponUpdate();
  99.             Process_Children();
  100.          }
  101.       }
  102.       
  103.       override public function get mUpgrades() : Array
  104.       {
  105.          return _Upgrades;
  106.       }
  107.    }
  108. }
  109.